package com.leyou.item.controller;

import com.leyou.item.pojo.Comment;
import com.leyou.item.service.CommentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CommentController {
    @Autowired
    private CommentService commentService;
    @PostMapping("/comment/save")
    public ResponseEntity<Void> save(@RequestBody List<Comment> comments){
        commentService.save(comments);
        return ResponseEntity.status(HttpStatus.NO_CONTENT).build();
    }
}
